class match(object):
    def __init__(self, dl_src, dl_dst, dl_type, nw_tos, nw_src, nw_dst, nw_proto, **kwargs):
        self.dl_src = dl_src
        self.dl_dst = dl_dst
        self.dl_type = dl_type
        self.nw_tos = nw_tos
        self.nw_src = nw_src
        self.nw_dst = nw_dst
	self.nw_proto = nw_proto
	#self.tp_src = kwargs.get("tp_src") #None
	for k,v in kwargs.iteritems():
            setattr(self,k,v)
	'''
	#similar  to:
        if "tp_dst" in kwargs:
            self.tp_dst = kwargs["tp_dst"]
	'''
if __name__ == "__main__":
    m1 = match(dl_src=1,dl_dst=2,nw_src=11,nw_dst=22,nw_proto="icmp",dl_type="ip",nw_tos=88)
    m2 = match(dl_src=1,dl_dst=2,dl_type="ip",nw_src=11,nw_dst=22,nw_proto="tcp",tp_src=111,tp_dst=222,nw_tos=88)
    #print dir(m1)
    #print dir(m2),m2.tp_src
    print m1.__dict__
    print m2.__dict__
